<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('收入类合同列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>合同类型：</label>
                                <input type="text" name="contractTypeName"/>
                            </li>
                            <li>
                                <label>合同类别：</label>
                                <input type="text" name="contractCategory"/>
                            </li>
                            <li>
                                <label>招采方式：</label>
                                <input type="text" name="contractIncomeConferMode"/>
                            </li>
                            <li>
                                <label>合同编号：</label>
                                <input type="text" name="contractIncomeCode"/>
                            </li>
                            <li>
                                <label>合同名称：</label>
                                <input type="text" name="contractIncomeName"/>
                            </li>
                            <li>
                                <label>合同状态：</label>
                                <select name="contractIncomeStatus" th:with="type=${@dict.getType('contract_status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>合同签订年份：</label>
                                <input type="text" name="signYear"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="credit:contractIncome:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="credit:contractIncome:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="credit:contractIncome:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="credit:contractIncome:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('credit:contractIncome:edit')}]];
        var removeFlag = [[${@permission.hasPermi('credit:contractIncome:remove')}]];
        var contractTypeNameDatas = [[${@dict.getType('contract_type')}]];
        var contractCategoryDatas = [[${@dict.getType('contract_category')}]];
        var contractIncomeConferModeDatas = [[${@dict.getType('zc_mode')}]];
        var contractIncomeStatusDatas = [[${@dict.getType('contract_status')}]];
        var prefix = ctx + "credit/contractIncome";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "收入类合同",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'contractIncomeUid',
                    title: '合同主键'
                },
                {
                    field: 'contractTypeName',
                    title: '合同类型',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(contractTypeNameDatas, value);
                    }
                },
                {
                    field: 'contractCategory',
                    title: '合同类别',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(contractCategoryDatas, value);
                    }
                },
                {
                    field: 'contractIncomeConferMode',
                    title: '招采方式',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(contractIncomeConferModeDatas, value);
                    }
                },
                {
                    field: 'contractIncomeCode',
                    title: '合同编号'
                },
                {
                    field: 'contractIncomeName',
                    title: '合同名称'
                },
                {
                    field: 'customerNames',
                    title: '合同对方'
                },
                {
                    field: 'signCompany',
                    title: '签订公司'
                },
                {
                    field: 'contractIncomeStatus',
                    title: '合同状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(contractIncomeStatusDatas, value);
                    }
                },
                {
                    field: 'contractIncomeTotalMoney',
                    title: '合同总额'
                },
                {
                    field: 'contractIncomeSignDate',
                    title: '新拟合同日期'
                },
                {
                    field: 'contractIncomeEffectiveDate',
                    title: '合同启用时间'
                },
                {
                    field: 'lastUpdateDate',
                    title: '更新时间'
                },
                {
                    field: 'contractIncomesAttribute4',
                    title: '财务部是否已审核费用明细'
                },
                {
                    field: 'contractIncomeStartTime',
                    title: '经营期限开始'
                },
                {
                    field: 'contractIncomeEndTime',
                    title: '经营期限结束'
                },
                {
                    field: 'contractIncomeIsNeedReceRemind',
                    title: '是否收款预警提醒'
                },
                {
                    field: 'contractIncomeReceRemindDays',
                    title: '提前多少天预警'
                },
                {
                    field: 'contractIncomeReceUnit',
                    title: '收款单位'
                },
                {
                    field: 'lineNames',
                    title: '合同归属'
                },
                {
                    field: 'contractIncomesAttribute12',
                    title: '是否违约'
                },
                {
                    field: 'hostUserName',
                    title: '主办部门经办人'
                },
                {
                    field: 'hostDeptName',
                    title: '主办部门'
                },
                {
                    field: 'contractIncomeMemo',
                    title: '备注'
                },
                {
                    field: 'hyUserName',
                    title: '合约管理经办人'
                },
                {
                    field: 'hyDeptName',
                    title: '合约管理部门'
                },
                {
                    field: 'signYear',
                    title: '合同签订年份'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>
